﻿function resizeLeftSideBar() {
    var currentLeftSide = parseInt($('#leftRegion').css("width"));
    var currentRightSide = parseInt($('#rightRegion').css("width"));

    //left side is open 
    if (currentLeftSide > 30) {
        $('#leftRegion').css(
            "width", "2%"
        );

        //right side is open
        if (currentRightSide > 30) {
            $('#centerRegion').css(
                "width", "78%"
             );            

        } else { //right side is close
            $('#centerRegion').css(
                "width", "96%"
            );            
        }

        //hide p innerHTML 
        $('#overview').css("display","none");
        $('#accordion').css("display", "none");

        //Change Icon of iconLeft
        $("#iconCloseLeftRegion").removeClass("icon-arrow-left-3");
        $("#iconCloseLeftRegion").addClass("icon-arrow-right-3");
        return;
    }


    //left side ist close 
    if (currentLeftSide < 30) {
        $('#leftRegion').css(
            "width", "20%"
        );
        
        //right side is open
        if (currentRightSide > 30) {
            $('#centerRegion').css(
                "width", "60%"
            );
        } else { //right side is close
            $('#centerRegion').css(
                "width", "78%"
            );
        }

        //show p innerHTML 
        $('#overview').css("display", "block");

        $('#accordion').css("display", "block");

        //Change Icon of iconLeft
        $("#iconCloseLeftRegion").removeClass("icon-arrow-right-3");
        $("#iconCloseLeftRegion").addClass("icon-arrow-left-3");

        return;
    }
}


function resizeRightSideBar() {
    var currentLeftSide = parseInt($('#leftRegion').css("width"));
    var currentRightSide = parseInt($('#rightRegion').css("width"));

    //right side is open 
    if (currentRightSide > 30) {
        $('#rightRegion').css(
            "width", "2%"
        );

        //left side is open
        if (currentLeftSide > 30) {
            $('#centerRegion').css(
                "width", "78%"
             );
        } else { //left side is close
            $('#centerRegion').css(
                "width", "96%"
            );
        }

        //hide p innerHTML 
        $('#options').css("display", "none");

        //Change Icon of iconRight
        $("#iconCloseRightRegion").removeClass("icon-arrow-right-3");
        $("#iconCloseRightRegion").addClass("icon-arrow-left-3");
        return;
    }


    //right side ist close 
    if (currentRightSide < 30) {
        $('#rightRegion').css(
            "width", "20%"
        );

        //left side is open
        if (currentLeftSide > 30) {
            $('#centerRegion').css(
                "width", "60%"
            );
        } else { //left side is close
            $('#centerRegion').css(
                "width", "78%"
            );
        }

        //show p innerHTML 
        $('#options').css("display", "block");

        //Change Icon of iconLeft
        $("#iconCloseRightRegion").removeClass("icon-arrow-left-3");
        $("#iconCloseRightRegion").addClass("icon-arrow-right-3");

        return;
    }

}

